using AiQiuQuan.Sport.Model.Models;
using AiQiuQuan.Sport.Core;

namespace AiQiuQuan.Sport.WebApi.Services
{
    /// <summary>
    /// 比赛管理
    /// </summary>
    public interface IGameService : ITransientDependency
    {
        /// <summary>
        /// 查询
        /// </summary>
        Task<GameDto> GetAsync(Guid id);

        /// <summary>
        /// 比赛详情
        /// </summary>
        Task<GameDto> QueryAsync(GameQueryRequestDto request);

        /// <summary>
        /// 比赛分页请求
        /// </summary>
        Task<PageResult<GameDto>> PageListAsync(GameQueryPageRequestDto request);

        /// <summary>
        /// 新增
        /// </summary>
        Task<UnaryResult> AddAsync(GameAddDto model);

        /// <summary>
        /// 修改
        /// </summary>
        Task<UnaryResult> UpdateAsync(GameUpdateDto model);

        /// <summary>
        /// 比赛状态修改
        /// </summary>
        Task<UnaryResult> UpdateGameStateAsync(GameStateUpdateDto request);

        /// <summary>
        /// 增加比赛管理员
        /// </summary>
        Task<UnaryResult> AddManageUserAsync(GameManageUserAddDto request);

        /// <summary>
        /// 删除比赛管理员
        /// </summary>
        Task<UnaryResult> DeleteManageUserAsync(GameManageUserDeleteDto request);

        /// <summary>
        /// 获取比赛管理员
        /// </summary>
        /// <param name="gameId">比赛ID</param>
        Task<List<GameManageUserDto>> GetGameManageUserListAsync(Guid gameId);

        /// <summary>
        /// 删除
        /// </summary>
        Task<UnaryResult> DeleteAsync(Guid id);

        /// <summary>
        /// 比赛报名
        /// </summary>
        Task<UnaryResult<GameJoinResultDto>> JoinAsync(GameJoinRequestDto request);

        /// <summary>
        /// 获取小组抽签信息
        /// </summary>
        Task<GameGroupDrawInfoDto> GetGroupDrawInfoAsync(GameRequestDto request);

        /// <summary>
        /// 小组自动抽签
        /// </summary>
        Task<List<GameGroupDrawTeamDto>> GroupAutoDrawAsync(GameRequestDto request);

        /// <summary>
        /// 非团体比赛队伍列表
        /// </summary>
        Task<List<GameTeamDto>> GetSingleGameTeamListAsync(GameTeamSingleRequestDto request);

        /// <summary>
        /// PC端非团体比赛队伍列表
        /// </summary>
        Task<List<GameTeamDto>> GetSingleGameTeamListPCAsync(GameTeamSingleRequestDto request);

        /// <summary>
        /// 团体比赛队伍概要列表
        /// </summary>
        Task<List<GameTeamSimpleDto>> GetSimpleGameTeamListAsync(GameTeamRequestDto request);

        /// <summary>
        /// PC端团体比赛队伍概要列表
        /// </summary>
        Task<List<GameTeamSimpleDto>> GetSimpleGameTeamListPCAsync(GameTeamRequestDto request);

        /// <summary>
        /// 团体比赛队伍列表
        /// </summary>
        /// <param name="businessId">队伍业务ID</param>
        Task<List<GameTeamDto>> GetGameTeamListAsync(Guid businessId);

        /// <summary>
        /// PC端团体比赛队伍列表
        /// </summary>
        /// <param name="businessId">队伍业务ID</param>
        Task<List<GameTeamDto>> GetGameTeamListPCAsync(Guid businessId);

        /// <summary>
        /// 获取比赛小组列表
        /// </summary>
        Task<List<GameGroupDto>> GetGameGroupListAsync(GameGroupRequestDto request);

        /// <summary>
        /// 小组信息更改
        /// </summary>
        Task<UnaryResult> UpdateGroupAsync(GameGroupUpdateDto request);

        /// <summary>
        /// 更新队伍头像
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<UnaryResult> UpdateTeamHeadUrlAsync(GameTeamHeadUrlRequestDto request);

        /// <summary>
        /// 结束小组赛
        /// </summary>
        /// <param name="groupId">小组ID</param>
        Task<UnaryResult> FinishGameGroupAsync(Guid groupId);

        /// <summary>
        /// 获取小组信息及对阵信息列表
        /// </summary>
        Task<List<GameGroupDto>> GetGameGroupAndVersusListAsync(GameGroupRequestDto request);

        /// <summary>
        /// 获取小组成员信息
        /// </summary>
        /// <param name="groupUserId">组成员ID</param>
        Task<GameGroupUserDto> GetGameGroupUserInfoAsync(Guid groupUserId);

        /// <summary>
        /// 保存小组抽签
        /// </summary>
        Task<UnaryResult> SaveGroupDrawLotsAsync(GameGroupDrawLotsRequestDto request);

        /// <summary>
        /// 小组比分输入
        /// </summary>
        Task<UnaryResult> FinishGroupVersusAsync(GameGroupVersusScoreAddDto request);

        /// <summary>
        /// 小组排名计算
        /// </summary>
        Task<UnaryResult> CalculateGroupRankAsync(GameGroupRankRequestDto request);

        /// <summary>
        /// 初始化淘汰赛首轮成员
        /// </summary>
        Task<UnaryResult> InitFirstKnockoutVersusMember(GameKnockoutVersusInitDto request);

        /// <summary>
        /// 淘汰赛比分输入
        /// </summary>
        Task<UnaryResult> FinishKnockoutVersusAsync(GameKnockoutVersusScoreAddDto request);

        /// <summary>
        /// 获取比赛轮次列表
        /// </summary>
        Task<List<GameKnockoutRoundsDto>> GetGameRoundsListAsync(GameRequestDto request);

        /// <summary>
        /// 淘汰赛对阵列表
        /// </summary>
        Task<List<GameKnockoutVersusDto>> GetGameKnockoutVersusListAsync(GameKnockoutVersusRequestDto request);

        /// <summary>
        /// 淘汰赛对阵信息修改
        /// </summary>
        Task<UnaryResult> UpdateGameKnockoutVersusInfoAsync(List<GameKnockoutVersusUpdateDto> request);

        /// <summary>
        /// 结束淘汰赛轮次比赛
        /// </summary>
        /// <param name="knockoutRoundsId">轮次ID</param>
        /// <returns></returns>
        Task<UnaryResult> FinishKnockoutRoundsAsync(Guid knockoutRoundsId);

        /// <summary>
        /// 自动报名比赛
        /// </summary>
        Task<UnaryResult> AutoJoinAsync(Guid gameId, bool isDraw = false);
    }
}
